package com.tpc.control.jpa;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Plant entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "plant", catalog = "production_control")
public class Plant implements java.io.Serializable {

	// Fields

	private String plantId;
	private String plantName;
	private String onLoading;
	private Timestamp lastUpdate;
	private String inputFileName;
	private String inactUpload;
	private Timestamp lastUpload;
	private Set<RoutingData> routingDatas = new HashSet<RoutingData>(0);
	private Set<PlantColumn> plantColumns = new HashSet<PlantColumn>(0);
	private Set<CommonData> commonDatas = new HashSet<CommonData>(0);

	// Constructors

	/** default constructor */
	public Plant() {
	}

	/** minimal constructor */
	public Plant(String plantId, String plantName, String onLoading,
			String inputFileName, String inactUpload) {
		this.plantId = plantId;
		this.plantName = plantName;
		this.onLoading = onLoading;
		this.inputFileName = inputFileName;
		this.inactUpload = inactUpload;
	}

	/** full constructor */
	public Plant(String plantId, String plantName, String onLoading,
			Timestamp lastUpdate, String inputFileName, String inactUpload,
			Timestamp lastUpload, Set<RoutingData> routingDatas,
			Set<PlantColumn> plantColumns, Set<CommonData> commonDatas) {
		this.plantId = plantId;
		this.plantName = plantName;
		this.onLoading = onLoading;
		this.lastUpdate = lastUpdate;
		this.inputFileName = inputFileName;
		this.inactUpload = inactUpload;
		this.lastUpload = lastUpload;
		this.routingDatas = routingDatas;
		this.plantColumns = plantColumns;
		this.commonDatas = commonDatas;
	}

	// Property accessors
	@Id
	@Column(name = "plant_id", unique = true, nullable = false, length = 4)
	public String getPlantId() {
		return this.plantId;
	}

	public void setPlantId(String plantId) {
		this.plantId = plantId;
	}

	@Column(name = "plant_name", nullable = false, length = 40)
	public String getPlantName() {
		return this.plantName;
	}

	public void setPlantName(String plantName) {
		this.plantName = plantName;
	}

	@Column(name = "on_loading", nullable = false, length = 1)
	public String getOnLoading() {
		return this.onLoading;
	}

	public void setOnLoading(String onLoading) {
		this.onLoading = onLoading;
	}

	@Column(name = "last_update", length = 19)
	public Timestamp getLastUpdate() {
		return this.lastUpdate;
	}

	public void setLastUpdate(Timestamp lastUpdate) {
		this.lastUpdate = lastUpdate;
	}

	@Column(name = "input_file_name", nullable = false, length = 200)
	public String getInputFileName() {
		return this.inputFileName;
	}

	public void setInputFileName(String inputFileName) {
		this.inputFileName = inputFileName;
	}

	@Column(name = "inact_upload", nullable = false, length = 1)
	public String getInactUpload() {
		return this.inactUpload;
	}

	public void setInactUpload(String inactUpload) {
		this.inactUpload = inactUpload;
	}

	@Column(name = "last_upload", length = 19)
	public Timestamp getLastUpload() {
		return this.lastUpload;
	}

	public void setLastUpload(Timestamp lastUpload) {
		this.lastUpload = lastUpload;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "plant")
	public Set<RoutingData> getRoutingDatas() {
		return this.routingDatas;
	}

	public void setRoutingDatas(Set<RoutingData> routingDatas) {
		this.routingDatas = routingDatas;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "plant")
	public Set<PlantColumn> getPlantColumns() {
		return this.plantColumns;
	}

	public void setPlantColumns(Set<PlantColumn> plantColumns) {
		this.plantColumns = plantColumns;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "plant")
	public Set<CommonData> getCommonDatas() {
		return this.commonDatas;
	}

	public void setCommonDatas(Set<CommonData> commonDatas) {
		this.commonDatas = commonDatas;
	}

}